<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header">

</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-8">
                <div class="ibox">
                    <div class="ibox-content">	
                        <div class="clients-list">
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" href="#tab-1"><i class="fa fa-user"></i> 预审信息</a>
                                </li>
                                <li class=""><a data-toggle="tab" href="#tab-2"><i class="fa fa-briefcase"></i> 会议信息</a>
                                </li>
                            </ul>
                            <br>
                            <div class="tab-content">
                                <div id="tab-1" class="tab-pane active">
                                    <div class="full-height-scroll">
                                        <div class="col-sm-12 col-sm-offset-0">
                                          <div class="panel panel-primary">
                                          	<div class="panel-heading">
                                          		<i class="fa fa-info-circle"></i> 详情
                                          	</div>
                                          	<div class="panel-body">
									            <div class="wrapper wrapper-content animated fadeInUp">
									                <div class="ibox">
									                    <div class="ibox-content">
									                        <div class="row">
									                            <div class="col-sm-12">
									                                <dl class="dl-horizontal">
									                                    <dt>状态：</dt>
									                                    <dd>
									                                    	<span th:if="${prepareEvolve.examineState == 0}" class="label label-warning">等待备案</span>
									                                    	<span th:if="${prepareEvolve.examineState == 1}" class="label label-primary">备案完成</span>
									                                    </dd>
									                                </dl>
									                            </div>
									                        </div>
									                        
									                        <div class="row">
									                            <div class="col-sm-12">
									                                <dl class="dl-horizontal" th:object="${prepareEvolve}">
									                                	
									                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
									                                    <dt>编号：</dt>
									                                    <dd th:id="prepareEvolveId" th:value="*{prepareEvolveId}" th:text="*{prepareEvolveId}">获取失败</dd>
									                                    
									                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
									                                    <dt>会议名称：</dt>
									                                    <dd th:text="*{conferenceFirst.conferenceName}">获取失败</dd>
									                                    <dd hidden="hidden" id="conferenceId" th:text="*{conferenceFirst.conferenceId}"></dd>
									                                    									                                    
									                                    <dt>&nbsp;</dt><dd th:if="*{examineState == 1}">&nbsp;</dd>
									                                    <dt>预审名单：</dt>
									                                    <dd style="float:left;margin-left: 10px;" th:each="user,userStat : ${recordUserList}">
																			<a class="label label-info" th:onclick="'javascript:openRight('+${user.userId}+')'" th:text="${user.userName}"></a>
																		</dd>
																		
									                                    <dt th:if="*{examineState == 0}">&nbsp;</dt><dd th:if="*{examineState == 0}">&nbsp;</dd>
									                                    <dt th:if="*{examineState == 0}" style="color: orange;font-size: 20px;">请选择通过名单：</dt>
									                                    <dd th:if="*{examineState == 0}" style="float:left;margin-left: 10px;margin-top: 5px;" th:each="user,userStat : ${recordUserList}">
									                                    	<input  th:name="${user.userId}" th:id='${userStat.index}' th:value="0" th:names="${user.userName}" type="checkbox" data-size="small">
									                                    </dd>
									                                    
									                                    <dt th:if="*{examineState == 1}">&nbsp;</dt><dd th:if="*{examineState == 1}">&nbsp;</dd>
									                                    <dt th:if="*{examineState == 1}">通过名单：</dt>
									                                    <dd style="float:left; margin-left: 10px;" th:if="${!#lists.isEmpty(recordPassUserList) and prepareEvolve.examineState == 1}"  th:each="user,userStat : ${recordPassUserList}">
																			<a class="label label-primary" th:onclick="'javascript:openRight('+${user.userId}+')'" th:text="${user.userName}"></a>
																		</dd>
																		
																		<dd th:if="${#lists.isEmpty(recordPassUserList) and prepareEvolve.examineState == 1}"><span class="label label-danger">无通过名单</span></dd>
									                                    <dt th:if="*{examineState == 1}">&nbsp;</dt><dd th:if="*{examineState == 1}">&nbsp;</dd>
									                                    <dt th:if="*{examineState == 1}">未通过名单：</dt>
									                                    <dd th:if="${!#lists.isEmpty(recordNotPassUserList)}" style="float:left;margin-left: 10px;"   th:each="user,userStat : ${recordNotPassUserList}">
																			<a class="label label-danger" th:onclick="'javascript:openRight('+${user.userId}+')'" th:text="${user.userName}"></a>
																		</dd>
																		
																		<dd th:if="${#lists.isEmpty(recordNotPassUserList) and prepareEvolve.examineState == 1}"><span class="label label-danger">无未通过名单</span></dd>
									                                    
									                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
									                                    <dt>预审对象名册：</dt>
									                                    <dd>
									                                    	<a>发展对象名册.xls</a>
									                                    	<a th:href="@{/module/proposer/review(userId=*{prepareEvolveId},type=examineRoster,fileName=*{examineRoster})}" class="btn btn-success btn-xs fa fa-edit" th:text="预览"></a>
                                    										<a th:href="@{/module/proposer/download(userId=*{prepareEvolveId},type=examineRoster,fileName=*{examineRoster})}" class="btn btn-success btn-xs fa fa-edit" th:text="下载"></a>
									                                    </dd>
									                                    
									                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
									                                    <dt>提交时间：</dt>
									                                    <dd th:text="*{#dates.format(examineSubmitTime,'yyyy-MM-dd HH:mm:ss')}">获取失败</dd>
									                                </dl>
									                            </div>
																
									                        </div>
									                        
									                      </div>
									                        <div class="row">&nbsp;</div>
									                        <div class="row">&nbsp;</div>
									                        <div class="row text-center">
									                        	<a type="button" href="javascript:" onclick="self.location=document.referrer;" class="btn btn-default btn-lg"><i class="fa fa-close"></i>&nbsp;返 回</a>&nbsp;&nbsp;
									                        	<a type="button" href="javascript:" th:if="${prepareEvolve.examineState == 0}" onclick="save()" class="btn btn-primary btn-lg"><i class="fa fa-check"></i>&nbsp;保 存</a>
									                        </div>
									                    </div>
									                </div>
									            </div>
									            <div class="panel-footer">
                                        			面板脚
                                   				</div>
								            </div>
								            
								            
								          </div>
								        </div>
                                </div>
                                
                                <div id="tab-2" class="tab-pane">
                                	o(*￣︶￣*)o ~~
                                </div>
                                
                            </div>

                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="ibox ">

                    <div class="ibox-content">
                        <div class="tab-content">
                            <div id="contact-1" class="tab-pane active">
                                <div class="row m-b-lg">
                                    <div class="col-lg-4 text-center">

                                        <div class="m-b-sm">
                                            <img th:src="@{/img/profile.jpg}" alt="image" class="img-circle" style="width: 120px"/>
                                        </div>
                                    </div>
                                    <div class="col-lg-8">
                                        <h3>个人简介</h3>
                                        <p>我从小就树立了一定要加入中国共产党的远大志向，并且一直持续到了今天，热情更是有增无减。
                                        	党的光辉形象就牢牢地铭刻在我的心中，鼓舞着我前进。还记得刚刚迈入学校大门的我，由于对自己的严格要求，在加入少先队时很荣幸地被选为少先队员代表在全校发言，
                                        	那一刻我第一次亲身感受到组织照耀下的光芒，并更加坚定了入党的信念。
                                        </p>
                                        <br>
                                        <button type="button" class="btn btn-primary btn-sm btn-block"><i class="fa fa-envelope"></i> 发送消息
                                        </button>
                                    </div>
                                </div>
                                <div class="client-detail">
                                    <div class="full-height-scroll">

                                        <strong>材料信息</strong>
										<div class="ibox">
						                    <div class="ibox-content">  
						                        
						                        <div class="row">
						                            <div class="col-sm-12">
						                                <dl class="dl-horizontal">
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>姓名：</dt>
						                                    <dd th:text="${user.userName}" id="userName"></dd>
						                                     
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>年龄：</dt>
						                                    <dd th:text="${user.age}" id="age"></dd>
						                                    
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>性别：</dt>
						                                    <dd th:text="${user.sex}" id="sex"></dd>
						                                    
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>身份证号码：</dt>
						                                    <dd th:text="${user.idCardNo}" id="idCardNo"></dd>
						                                    
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>邮箱：</dt>
						                                    <dd th:text="${user.email}" id="email"></dd>
						                                    
						                                    <dt>&nbsp;</dt><dd>&nbsp;</dd>
						                                    <dt>电话号码：</dt>
						                                    <dd th:text="${user.phonenumber}" id="phonenumber"></dd>
						                                </dl>
						                            </div>
								                   <div class="col-sm-12" id="cluster_info">
								                       <dl class="dl-horizontal">
								                       
														   <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">入党申请书</a></dt>
								                           <dd id="partyApplication">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=partyApplication,fileName=${user.proposer.partyApplication})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=partyApplication,fileName=${user.proposer.partyApplication})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">思想汇报一</a></dt>
								                           <dd id="reportFirst">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=reportFirst,fileName=${user.proposer.reportFirst})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=reportFirst,fileName=${user.proposer.reportFirst})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">思想汇报二</a></dt>
								                           <dd id="reportSecond">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=reportSecond,fileName=${user.proposer.reportSecond})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=reportSecond,fileName=${user.proposer.reportSecond})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">思想汇报三</a></dt>
								                           <dd id="reportThird">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=reportThird,fileName=${user.proposer.reportThird})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=reportThird,fileName=${user.proposer.reportThird})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">思想汇报四</a></dt>
								                           <dd id="reportFourth">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=reportThird,fileName=${user.proposer.reportFourth})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=reportThird,fileName=${user.proposer.reportFourth})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">入党积极分子考察登记表</a></dt>
								                           <dd id="activistCultivate">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=activistCultivate,fileName=${user.proposer.activistCultivate})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=activistCultivate,fileName=${user.proposer.activistCultivate})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">政治审查情况报告</a></dt>
								                           <dd id="verdictMaterial">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=verdictMaterial,fileName=${user.politicalExamine.verdictMaterial})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=verdictMaterial,fileName=${user.politicalExamine.verdictMaterial})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">发展对象短期集中培训情况登记表</a></dt>
								                           <dd id="developmentCultivate">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=developmentCultivate,fileName=${user.proposer.developmentCultivate})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=developmentCultivate,fileName=${user.proposer.developmentCultivate})}'>下载</a>
								                           </dd>
								                           
								                           <dt>&nbsp;</dt><dd>&nbsp;</dd>
								                           <dt><a class="text-success">发展对象预审的意见</a></dt>
								                           <dd id="developmentRemaineVerdict">
								                            <a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/review(userId=${user.userId},type=developmentRemaineVerdict,fileName=${user.proposer.developmentRemaineVerdict})}'>预览</a>&nbsp;&nbsp;
								                      		<a class="btn btn-success btn-xs fa fa-edit" th:href='@{/module/proposer/download(userId=${user.userId},type=developmentRemaineVerdict,fileName=${user.proposer.developmentRemaineVerdict})}'>下载</a>
								                           </dd>
								                           <dd style="margin-top: 5px;">
						                                    	<button class="btn btn-warning" th:text="点击上传发展对象预审的意见" th:id="userId" th:value="${user.userId}" onclick="upload()"></button>
						                                    </dd>
								                           
								                       </dl>
								                   </div>
						                        </div>
						                        
						                    </div>
						                </div>
                                        
                                        <strong>备注</strong>

                                        <hr/>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
	<div th:include="include :: footer"></div>
	<!-- 甜甜的弹出层 -->
 	<script src="https://cdn.bootcss.com/limonte-sweetalert2/7.21.1/sweetalert2.all.js"></script>
	<script th:inline="javascript">
		var prefix = "/module/prepareEvolve";
		
		//初始化显示隐藏发展对象预审的意见
		if([[${user.proposer.developmentRemaineVerdict == null}]]){
			//隐藏《发展对象预审的意见》预览下载，显示上传文件
			$("#developmentRemaineVerdict").hide();
			$("#userId").show();
		}else{
			//显示《发展对象预审的意见》预览下载，隐藏上传文件
			$("#developmentRemaineVerdict").show();
			$("#userId").hide();
		}
		
		function save(){
			//获取所有复选框
			var userList = $('input:checkbox').toArray();
			//通过名单
			var passList = "";
			//未通过名单
			var notPassList = "";
			//循环分别获取通过和未通过名单并组装
			for(var i = 0; i < userList.length; i++){
				if(userList[i].value == '0'){
					notPassList = notPassList + userList[i].name + ',';
				}else if(userList[i].value == '1'){
					passList = passList + userList[i].name + ',';
				}
			}
			submit(passList, notPassList);
		}
		
		//提交名单
		function submit(passList, notPassList){
			$.ajax({
				url: '/module/prepareEvolve/saveExamineUserList',
				type: 'post',
				datatype: 'json',
				data: {'examineSuccess': passList, 'examineFail': notPassList, 'prepareEvolveId': $('#prepareEvolveId').html()
				, 'conferenceIdFirst': $('#conferenceId').html()},
				success: function(data){
					if(data.code == 0){
						swal({
							title: '祝贺您',
							text: '备案成功',
							type: 'success'						
						}).then(function(value){
							//返回上一级并刷新
							window.location.href=document.referrer;
						});
					}else{
						swal(
    					"备案失败",
    					"请联系网站管理员",
    					"error"
    				);
					}
				},
				error: function(data){
					swal(
    					"请求失败",
    					"请联系网站管理员",
    					"error"
    				);
				}
			});
		}
		
		//根据复选框个数初始化
		for(var i = 0; i < $('input:checkbox').length; i++){
			var userName = $('#'+ i +'').attr('names');
			$('[id='+ i +']').bootstrapSwitch({
				onText:"通过",
				offText:"未通过",
				onColor:"success",
				offColor:"danger",
				labelText:userName,
				size:"small",
				onSwitchChange:function(event,state){
					if(state==true){
						$(this).val("1");
					}else{
						$(this).val("0");
						
					}
				}
			});
		}
		
		function openRight(userId){
			$.ajax({
				url: prefix + '/selectUserById',
				type: 'post',
				dataType: 'json',
				data: {"userId": userId},
				success: function(data){
					console.log(data);
					var sex = "";
					switch(data.sex){
						case '0':
							sex = '未知';
							break;
						case '1':
							sex = '男';
							break;
						case '2':
							sex = '女';
							break;
					}
					//更新资料栏
					$("#sex").html(sex);
					$("#userName").html(data.userName);
					$("#age").html(data.age);
					$("#idCardNo").html(data.idCardNo);
					$("#email").html(data.idCardNo);
					$("#phonenumber").html(data.phonenumber);
					
					$("#partyApplication").html(
                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=partyApplication&fileName='+ data.proposer.partyApplication +'">预览</a>&nbsp;&nbsp;' +
                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=partyApplication&fileName='+ data.proposer.partyApplication +'">下载</a>');
					$("#reportFirst").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=reportFirst&fileName='+ data.proposer.reportFirst +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=reportFirst&fileName='+ data.proposer.reportFirst +'">下载</a>');
					$("#reportSecond").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=reportSecond&fileName='+ data.proposer.reportSecond +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=reportSecond&fileName='+ data.proposer.reportSecond +'">下载</a>');
					$("#reportThird").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=reportThird&fileName='+ data.proposer.reportThird +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=reportThird&fileName='+ data.proposer.reportThird +'">下载</a>');
					$("#reportFourth").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=reportFourth&fileName='+ data.proposer.reportFourth +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=reportFourth&fileName='+ data.proposer.reportFourth +'">下载</a>');
					$("#verdictMaterial").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=verdictMaterial&fileName='+ data.proposer.verdictMaterial +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=verdictMaterial&fileName='+ data.proposer.verdictMaterial +'">下载</a>');
					$("#activistCultivate").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=activistCultivate&fileName='+ data.proposer.activistCultivate +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=activistCultivate&fileName='+ data.proposer.activistCultivate +'">下载</a>');
					$("#developmentCultivate").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=developmentCultivate&fileName='+ data.proposer.developmentCultivate +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=developmentCultivate&fileName='+ data.proposer.developmentCultivate +'">下载</a>');
					if(data.proposer.developmentRemaineVerdict == null){
						//更新文件上传者
						$("#userId").val(data.userId);
						$("#userId").show();
						$("#developmentRemaineVerdict").hide();
					}else{
						$("#developmentRemaineVerdict").show();
						$("#userId").hide();
						$("#developmentRemaineVerdict").html(
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/review?userId='+ data.userId +'&type=developmentRemaineVerdict&fileName='+ data.proposer.developmentRemaineVerdict +'">预览</a>&nbsp;&nbsp;' +
	                                    '<a class="btn btn-success btn-xs fa fa-edit" href="/module/proposer/download?userId='+ data.userId +'&type=developmentRemaineVerdict&fileName='+ data.proposer.developmentRemaineVerdict +'">下载</a>');
					}
					
					
				},
				fail: function(msg){
					alert("请求失败");
				}
			});
		}
		
		//上传修改后的积极分子备案登记表
		function upload(){
			swal({
		  title: '提交文件',
		  input: 'file',
		    inputAttributes: {
    			accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword'
  			},
		  showCancelButton: true,
		  confirmButtonText: '确认提交',
		  showLoaderOnConfirm: true,
		  //提交前函数
		  preConfirm: function(file) {
		  	//校验函数
		    return new Promise(function(resolve, reject) { //返回resolve()为通过，reject()拒绝
		      //校验是否为doc或者docx
		        if (file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || value.type === 'application/msword') {
		          resolve();
		        } else {
		            swal(
				    '文件格式不正确！',
				    '只能上传docx类型的文件',
				    'warning'
				  ); 
		        }
		    });
		  },
		  allowOutsideClick: false
		}).then(	//接着执行
		   function (file) {
		   //如果没有传入文件，而是点击取消，则不采取操作
		   if(file.value == undefined){
				return;		   
		   }
		   var fm = new FormData();
		   fm.append("file", file.value);
		   fm.append("userId", $("#userId").val());
		   fm.append("type", 'developmentRemaineVerdict')
		   $.ajax({
		   		url: '/module/proposer/materials/upload',
		   		type: 'post',
		   		data: fm,
		   		dataType: 'json',
		   		contentType: false, //禁止设置请求类型
           		processData: false, //禁止jquery对DAta数据的处理,默认会处理
            	//禁止的原因是,FormData已经帮我们做了处理
		   		success: function(result){
		   			if(result.code === 0){
		   				swal(
						  '一切顺利',
						  result.msg,
						  'success'
						).then(function(){
							//刷新页面
							//window.location.reload();
						});
						
		   			} else{
		   				swal(
						  '抱歉',
						  result.msg,
						  'error'
						)
		   			}
		   		},
		   		error: function(result){
		   				swal(
						  '抱歉',
						  '请求失败，请于网站管理员联系',
						  'error'
						)
		   		}
		   });
		}
		);
		}
	</script>
</body>
</html>